<script type="text/javascript" src="animal.js"></script> 
<script type="text/javascript" src="cat.js"></script> 
<script type="text/javascript" src="dog.js"></script> 
<script type="text/javascript" src="eatmatch.js"></script> 

<script>
    var a = new eatmatch();
    var cat1 = new cat();
    cat1.name = "jiafei";

    var dog1 = new dog();
    dog1.name = "odi";

    var list = [cat1, dog1];

   
    document.write( a.work(list));
</script>